//JavaScript Framework 2.0 Code
try{
Type.registerNamespace('com.yonyou.ncmm_pac_pda.RefTextDemoWindowController');
com.yonyou.ncmm_pac_pda.RefTextDemoWindowController = function() {
    com.yonyou.ncmm_pac_pda.RefTextDemoWindowController.initializeBase(this);
    this.initialize();
}
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$initialize(){
    //you can programing by $ctx API
    //get the context data through $ctx.get()
    //set the context data through $ctx.push(json)
    //set the field of the context through $ctx.put(fieldName, fieldValue)
    //get the parameter of the context through $ctx.param(parameterName)
    //Demo Code:
    //    var str = $ctx.getString();      //获取当前Context对应的字符串
    //    alert($ctx.getString())          //alert当前Context对应的字符串
    //    var json = $ctx.getJSONObject(); //获取当前Context，返回值为json
    //    json["x"] = "a";        //为当前json增加字段
    //    json["y"] = [];           //为当前json增加数组
    //    $ctx.push(json);            //设置context，并自动调用数据绑定
    //    
    //    put方法需手动调用databind()
    //    var x = $ctx.get("x");    //获取x字段值
    //    $ctx.put("x", "b");     //设置x字段值
    //    $ctx.put("x", "b");     //设置x字段值
    //    $ctx.databind();            //调用数据绑定才能将修改的字段绑定到控件上
    //    var p1 = $param.getString("p1");   //获取参数p2的值，返回一个字符串
    //    var p2 = $param.getJSONObject("p2");   //获取参数p3的值，返回一个JSON对象
    //    var p3 = $param.getJSONArray("p3");   //获取参数p1的值，返回一个数组
    
    //your initialize code below...
    
}
    
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$evaljs(js){
    eval(js)
}
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$txtmaterial_onlongclick(sender, args){
	NCMMRefModel.openRefDialog(NCMMRefModel.StockorgRefModel,"txt_material");
}
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$wbutton1_onclick(sender, args){
    NCMMPubUtil.createTable(StockorgVO);
	$alert("建表完成");
	for(var i=0;i<3;i++){
		var org={
			"pk_stockorg":"pkstockorg"+i,
			"code":"code"+i,
			"name":"name"+i,
			"shortname":"shortname"+i
		};
		NCMMPubUtil.insertVO(StockorgVO,org);
	}
	
}
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$viewPage0_onload(sender, args){
	var refinfos={
			"txt_material":NCMMRefModel.StockorgRefModel
		}
	NCMMRefModel.registerRefInfo("viewPage0",refinfos);
}
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$btn_fetchvalue_onclick(sender, args){
	$ctx.dataCollect();
}
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$btn_initlist_onclick(sender, args){
	var listvalues=new Array();
	for(var i=0;i<3;i++){
		var listvalue={
			lbl_mid:"mid"+i,
			lbl_orgid:"orgid"+i,
			lbl_price:"price"+i
		}
		listvalues.push(listvalue);
	}
	$ctx.put("list_dynamic",listvalues);
	$ctx.dataBind();
}
function com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$pnlrefinfo_onload(sender, args){
}
com.yonyou.ncmm_pac_pda.RefTextDemoWindowController.prototype = {
    pnlrefinfo_onload : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$pnlrefinfo_onload,
    btn_initlist_onclick : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$btn_initlist_onclick,
    btn_fetchvalue_onclick : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$btn_fetchvalue_onclick,
    viewPage0_onload : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$viewPage0_onload,
    wbutton1_onclick : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$wbutton1_onclick,
    txtmaterial_onlongclick : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$txtmaterial_onlongclick,
    initialize : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$initialize,
    evaljs : com$yonyou$ncmm_pac_pda$RefTextDemoWindowController$evaljs
};
com.yonyou.ncmm_pac_pda.RefTextDemoWindowController.registerClass('com.yonyou.ncmm_pac_pda.RefTextDemoWindowController',UMP.UI.Mvc.Controller);
}catch(e){$e(e);}
